The original data was modified to match the region name in the previous map. All Station Names were converted to their region name.
climate_change <- read.csv(file = "Weather Data Bangladesh (1948 - 2013).csv",TRUE, sep = ",", stringsAsFactors = FALSE)
str(climate_change)
## 'data.frame': 21120 obs. of 18 variables:
## $ SL : int 0 1 2 3 4 5 6 7 8 9 ...
## $ region : chr "borishal" "borishal" "borishal" "borishal" ...
## $ YEAR : int 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 ...
## $ Month : int 1 1 1 1 1 1 1 1 1 1 ...
## $ Max.Temp : num 29.4 30 28.2 26.6 30 27.8 26.6 29.4 30.1 31.1 ...
## $ Min.Temp : num 12.3 14.1 12.3 12.3 13.3 12.7 12.3 14.3 15.1 15.5 ...
## $ Rainfall : num 0 0 0 2 10 0 2 17 104 0 ...
## $ Relative.Humidity: num 68 77 77 77 75 72 77 74 80 77 ...
## $ Wind.Speed : num 0.454 0.454 0.454 0.454 0.454 ...
## $ Cloud.Coverage : num 0.6 0.8 0.6 1 1.6 0.5 1 0.4 1 1.7 ...
## $ Bright.Sunshine : num 7.83 7.83 7.83 7.83 7.83 ...
## $ Station.Number : int 41950 41950 41950 41950 41950 41950 41950 41950 41950 41950 ...
## $ X_COR : num 536810 536810 536810 536810 536810 ...
## $ Y_COR : num 510152 510152 510152 510152 510152 ...
## $ LATITUDE : num 22.7 22.7 22.7 22.7 22.7 22.7 22.7 22.7 22.7 22.7 ...
## $ LONGITUDE : num 90.4 90.4 90.4 90.4 90.4 ...
## $ ALT : int 4 4 4 4 4 4 4 4 4 4 ...
## $ Period : num 1949 1950 1951 1952 1953 ...
head(climate_change)
## SL region YEAR Month Max.Temp Min.Temp Rainfall Relative.Humidity
## 1 0 borishal 1949 1 29.4 12.3 0 68
## 2 1 borishal 1950 1 30.0 14.1 0 77
## 3 2 borishal 1951 1 28.2 12.3 0 77
## 4 3 borishal 1952 1 26.6 12.3 2 77
## 5 4 borishal 1953 1 30.0 13.3 10 75
## 6 5 borishal 1954 1 27.8 12.7 0 72
## Wind.Speed Cloud.Coverage Bright.Sunshine Station.Number X_COR Y_COR
## 1 0.4537037 0.6 7.831915 41950 536809.8 510151.9
## 2 0.4537037 0.8 7.831915 41950 536809.8 510151.9
## 3 0.4537037 0.6 7.831915 41950 536809.8 510151.9
## 4 0.4537037 1.0 7.831915 41950 536809.8 510151.9
## 5 0.4537037 1.6 7.831915 41950 536809.8 510151.9
## 6 0.4537037 0.5 7.831915 41950 536809.8 510151.9
## LATITUDE LONGITUDE ALT Period
## 1 22.7 90.36 4 1949.01
## 2 22.7 90.36 4 1950.01
## 3 22.7 90.36 4 1951.01
## 4 22.7 90.36 4 1952.01
## 5 22.7 90.36 4 1953.01
## 6 22.7 90.36 4 1954.01
knitr::opts_chunk$set(echo = TRUE)
From the bar plot, we can see temperature has increases in last few decades, also there is a sharp contrast in humidity change suggesting sudden heavy rain and extreme weather.
library(ggplot2)
library(plotly)
climate_change_chart <- ggplot(climate_change, aes(x = YEAR , y = Relative.Humidity, fill = Max.Temp)) +
xlab("Year") +
ylab("Relative Humidity") +
theme_minimal(base_size = 14) + scale_fill_viridis_c()
barplot <- climate_change_chart +
geom_bar( position = "dodge", stat = "identity",color= "white")
ggplotly(barplot)
From the bar plot, we can see rainfall intensity has increases in last few decades
climate_change_chart2 <- ggplot(climate_change, aes(x = YEAR , y = Rainfall , fill = Max.Temp )) +
xlab("Year") +
ylab("Rainfall") +
theme_minimal(base_size = 14)+ scale_fill_viridis_c()
barplot2 <- climate_change_chart2 +
geom_bar( position = "dodge", stat = "identity",color= "white")
ggplotly(barplot2)
We can see the increase in temperature was relatively high in Dhaka Division As Dhaka is the capital, it has seen an intense urbanization in recent years aiding to the increased temperature.
library(lubridate)
# adding Year-Month variable as date
climate_change_ymd <- climate_change %>%
mutate(year_month = ymd(paste(climate_change$YEAR, climate_change$Month, truncated = 1)))
Min_t1 <- ggplot(climate_change_ymd, aes(year_month, Min.Temp, color = region)) +
geom_line() +
geom_smooth(se=FALSE, linetype = "dotted") +
labs(title = "Minimum Temperature (1949-2013)",
x = "Year",
y = "Minimum Temperature") +
theme(plot.title = element_text(hjust = 0.5))
ggplotly(Min_t1)
Max_t1 <- ggplot(climate_change_ymd, aes(year_month, Max.Temp, color = region)) +
geom_line() +
geom_smooth(se=FALSE, linetype = "dotted") +
labs(title = "Maximum Temperature (1949-2013)",
x = "Year",
y = "Maximum Temperature") +
theme(plot.title = element_text(hjust = 0.5))
ggplotly(Max_t1)
knitr::opts_chunk$set(echo = TRUE)